<div class="widgets">
    <div class="widget categories">
        <h3>Categories</h3>
        <ul>
            {foreach $categories as $c}
            <li><a href="blog.php?cat={$c.id}">{$c.name} ({$c.posts})</a></li>
            {/foreach}
        </ul>
    </div>
    <div class="widget tags">
        <h3>Tags</h3>
        {foreach $tags as $tag => $size}
        <a href="blog.php?tag={$tag}" class="{$size}">{$tag}</a>
        {/foreach}
    </div>
</div>